all: main.rel board.rel lcd.rel ds1302.rel alarm.rel stopwatch.rel date.rel
	sdcc main.rel board.rel lcd.rel ds1302.rel alarm.rel stopwatch.rel date.rel

main.rel: main.c
	sdcc -c main.c

board.rel: board.c board.h
	sdcc -c board.c

lcd.rel: lcd.c lcd.h
	sdcc -c lcd.c

ds1302.rel: ds1302.c ds1302.h
	sdcc -c ds1302.c

alarm.rel: alarm.c alarm.h
	sdcc -c alarm.c

stopwatch.rel: stopwatch.c stopwatch.h
	sdcc -c stopwatch.c

date.rel: date.c date.h
	sdcc -c date.c

flash: all
	stcgal main.ihx

clean:
	rm main.lk main.map *.ihx *.lst *.asm *.rel *.mem *.rst *.sym
